package sctu.edu.java.year2016.team08.chenjing.day20160522.chapter6_1;

/**在项目中创建Number类，判断字符串“mingrikejijavabu”中字符'i'出现了几次，并将结果输出。
 * Created by AD on 2016/5/22.
 */
public class Number {
    public static void main(String[] args) {
     char[] arr={'m','i','n','g','r','i','k','e','j','i','j','a','v','a','b','u'};
        int m=0;
            for(int i=0;arr[i]!='u';i++)
            {
                if(arr[i]=='i')
                    m=m+1;
            }

        System.out.println("一共有"+m+"个i");
        }

    }

